import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { LoginComponent } from './core/login/login.component';
//home
import { HomeComponent } from './home/home.component';
import { HomePageComponent } from './home/home-page/home-page.component';
//user
import { UserComponent } from './user/user.component';
import { RoleComponent } from './user/role/role.component';
import { RolesComponent } from './user/roles/roles.component';
import { ManagementComponent } from '../app/user/management/management.component';
import { PrivilegeComponent } from './user/privilege/privilege.component';
import { InstitutionComponent } from './user/institution/institution.component';
import { EffectComponent } from '../app/user/effect/effect.component';
//system
import { SystemComponent } from '../app/system/system.component';
import { SystemSysconfigComponent } from '../app/system/sysconfig/sysconfig.component';
import { TaskComponent } from '../app/system/task/task.component';
import { JournalComponent } from '../app/system/journal/journal.component';
import { TerminalComponent } from '../app/system/terminal/terminal.component';
import { IpRuleComponent } from '../app/system/ip-rule/ip-rule.component';
import { ScopeAuthorizationComponent } from '../app/system/scope-authorization/scope-authorization.component';
import { ApplicationComponent } from '../app/system/application/application.component';
import { CentralComponent } from '../app/system/central/central.component';
import { DatabaseComponent } from 'app/system/database/database.component';
import { ProductTypeComponent } from 'app/system/product-type/product-type.component';
import { KeywordTableManagementComponent} from 'app/system/keyword-table-management/keyword-table-management.component';
import { PushedComponent} from 'app/system/pushed/pushed.component';
import { TemplatePathComponent} from 'app/system/template-path/template-path.component';
import { ThemetableTagComponent } from 'app/system/themetable-tag/themetable-tag.component';
import { ProjectComponent } from 'app/system/project/project.component';

//无权限
import { JurisdictionComponent } from '../app/core/jurisdiction/jurisdiction.component';
import { NoauthorityComponent } from '../app/core/noauthority/noauthority.component';

//产品标引任务
import { ProductComponent } from '../app/product/product.component';
import { ProductIndexingTaskComponent } from '../app/product/product-indexing-task/product-indexing-task.component';
import { ProductIndexingTaskListComponent } from '../app/product/product-indexing-task/list/product-indexing-task-list.component';
import { ProductIndexingTaskAuditComponent } from '../app/product/product-indexing-task/audit/product-indexing-task-audit.component';
import { ProductIndexingTaskContentComponent } from '../app/product/product-indexing-task/content/product-indexing-task-content.component';

//内容管理
import { ContentComponent } from '../app/content/content.component';
import { ContentProductComponent } from '../app/content/product/content-product.component';
import { ContentInnertextComponent } from '../app/content/innertext/content-innertext.component';

//内文标引任务
import { InternalComponent } from '../app/internal/internal.component';
import { InternalIndexingTaskComponent } from '../app/internal/internal-indexing-task/internal-indexing-task.component';
//主题词管理
import {KeywordComponent } from '../app/keyword/keyword.component';

//同义词管理
import { SynonymComponent } from '../app/synonym/synonym.component';
import { SynonymManagementComponent } from '../app/synonym/synonym-management/synonym-management.component';
import {InnerindexStyleComponent} from './system/innerindex-style/innerindex-style.component';
import { TrialComponent } from './keyword/trial/trial.component';
import { UnreviewedComponent } from './keyword/unreviewed/unreviewed.component';

//报表统计
import { ReportComponent } from '../app/report/report.component';
import { ReportProductComponent} from '../app/report/report-product/report-product.component';
import { ReportInnerComponent } from '../app/report/report-inner/report-inner.component';
import { ReportCaseComponent } from '../app/report/report-case/report-case.component';
import { ReportThemeComponent } from '../app/report/report-theme/report-theme.component';
import { ReportUserComponent } from '../app/report/report-user/report-user.component';
import { ThemeTagComponent } from './system/theme-tag/theme-tag.component';
import { ProductTaskTemplateComponent } from './system/product-task-template/product-task-template.component';
import { ProductTaskTemplateAttributeComponent } from './system/product-task-template-attribute/product-task-template-attribute.component';

const routes: Routes = [
  // 以后在这里改动配置

  { path: 'login', component: LoginComponent },
  {
    path: 'home', component: HomeComponent,
    children: [
      {
        path: '', component: HomePageComponent
      },
    ]
  },
  {
    path: 'user', component: UserComponent,
    children: [
      { path: '', component: RolesComponent },
      { path: 'roles', component: RolesComponent },
      { path: 'role', component: RoleComponent },
      { path: 'management', component: ManagementComponent },
      { path: 'privilege', component: PrivilegeComponent },
      { path: 'institution', component: InstitutionComponent },
      { path: 'effect', component: EffectComponent },
      { path: 'noauthority', component: NoauthorityComponent }
    ]
  },
  {
    path: 'system', component: SystemComponent,
    children: [
      { path: '', component: ProductTypeComponent },
      { path: 'sysconfig', component: SystemSysconfigComponent },
      { path: 'task', component: TaskComponent },
      { path: 'journal', component: JournalComponent },
      { path: 'terminal', component: TerminalComponent },
      { path: 'ip-rule', component: IpRuleComponent },
      { path: 'scope-authorization', component: ScopeAuthorizationComponent },
      { path: 'application', component: ApplicationComponent },
      { path: 'noauthority', component: NoauthorityComponent },
      { path: 'database', component: DatabaseComponent },
      { path: 'central', component: CentralComponent },
      { path: 'product-type', component: ProductTypeComponent },
      { path: 'table', component: KeywordTableManagementComponent },
      { path: 'table-tag', component: ThemetableTagComponent },
      { path: 'theme-tag', component: ThemeTagComponent },
      { path: 'pushed', component: PushedComponent },
      { path: 'template-path', component: TemplatePathComponent },
      { path: 'innerindex-style', component: InnerindexStyleComponent },
      { path: 'project', component: ProjectComponent },
      { path: 'template', component: ProductTaskTemplateComponent },
      { path: 'template_attribute',component: ProductTaskTemplateAttributeComponent }
    ]
  }, {
    path: 'report', component: ReportComponent,
    children: [
      { path: '', component: ReportProductComponent },
      { path: 'product', component: ReportProductComponent },
      { path: 'inner', component: ReportInnerComponent },
      { path: 'case', component: ReportCaseComponent },
      { path: 'theme', component: ReportThemeComponent },
      { path: 'useby', component: ReportUserComponent },
    ]
  },
  {
    path: 'product', 
    component: ProductComponent,
    children: [
      { 
        path: '', 
        redirectTo:'list',
        pathMatch: 'full',
      },{
        path: 'list', 
        component:ProductIndexingTaskListComponent,
      },{
        path: 'audit', 
        component: ProductIndexingTaskAuditComponent
      },{
        path: 'content',
        component: ProductIndexingTaskContentComponent
      }
    ]
  },
  {
    path: 'content', 
    component: ContentComponent,
    children: [
      {path: 'product',component: ContentProductComponent},
      {path: 'innertext',component: ContentInnertextComponent}
    ]
  },
  {
    path: 'internal', component: InternalComponent,
    children: [
      { path: '', component: InternalIndexingTaskComponent },
    ]
  },
  {
    path: 'keyword', component: KeywordComponent,
    children: [
      { 
        path: '', 
        redirectTo:'trial',
        pathMatch: 'full',
      },{
        path: 'trial', 
        component:TrialComponent,
      },{
        path: 'unreviewed', 
        component: UnreviewedComponent
      },
    ]
  },
  {
    path: 'synonym', component: SynonymComponent,
    children: [
      { path: '', component: SynonymManagementComponent },
    ]
  },
  { path: 'jurisdiction', component: JurisdictionComponent, },
  { path: '', redirectTo:'login',pathMatch: 'full'},
  { path: '**', component: KeywordComponent, pathMatch: 'full' }
];
// 将路由配置导出为 appRouting 以供调用, 子模块中的路由使用 forChild 而不是 forRoot
//export const appRouting = RouterModule.forRoot(routes);
@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }